﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Web.Http;
using HttpController.Filters;
using System.IO;
using System.Net.Http.Formatting;

namespace HttpController
{
    public class TestPostController : ApiController
    {
        public IEnumerable<string> Get()
        {
            return new List<string> { "string1", "string2", "string3", "string4" };
        }

        [RequireAuthorizationAttribute]
        public IEnumerable<string> Post(TestPostModel obj)
        {            
            IList<string> rs = new List<string>();
            rs.Insert(0, obj.buy_amount);
            rs.Insert(1, obj.user_id);
            return rs;
        }
    }

    public class TestPostModel
    {
        public string user_id { get; set; }
        public string buy_time { get; set; }
        public string buy_product { get; set; }
        public string buy_amount { get; set; }
        public string user_from { get; set; }
    }

    /*
     * {"user_id":1234,"buy_time":"2014-11-06 10:29:06","buy_product":"bkd","buy_amount":"dfd"}
     * user_id=1234&buy_time=2345&buy_product=4444&buy_amount=dddd
     */
}